package com.he.hsdyc.common;


import com.he.hsdyc.entity.msg.ErrorCode;

public class OrderException extends RuntimeException {
    private Integer code;
    private String message;

    public OrderException() {

    }

    public OrderException(String message){
        super(message);
    }

    public OrderException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    //定义枚举类，以错误码加信息的形式返回
    public OrderException(ErrorCode errorCode) {
        this.message = errorCode.getMsg();
        this.code = errorCode.getCode();
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
